package jin.si.com.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;

/**
 * @description: 作者
 * @ClassName Person
 * @Author MT
 * @Date 2021/5/6 9:09
 **/
public class Person {

    //json注解
    //@JsonProperty指定别名
    @JsonProperty("id_1")
    private int id;

    private String name;

    //@JsonIgnore指定字段不展示
    @JsonIgnore
    private String password;

    //@JsonInclude(JsonInclude.Include.NON_NULL)过滤空字段
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<Product> list;

    //@JsonFormat()指定日期格式
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",locale="zh",timezone = "GMT+8")
    private Date date;


    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public List<Product> getList() {
        return list;
    }

    public void setList(List<Product> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", list=" + list +
                '}';
    }
}
